package ops.model.manager;

import java.io.File;

import ops.model.Course;

public class CourseManager extends EntityManager<Course> {

	private static final File COURSES_FILE = new File("data/courses.dat");
	
	public CourseManager() {
		super();
	}
	
	@Override
	public File getFile() {
		return COURSES_FILE;
	}
	
	@Override
	protected Object getKeyForEntity(Course element) {
		return element.getCode();
	}

	@Override
	public Course remove(Object key) {
		// TODO students references courses, so what should we do when courses are deleted?
		// 1. remove the student
		// 2. only remove the reference
		return super.remove(key);
	}

}
